﻿using LinnerToolkit.Core.Codec;
using System;
using System.Collections.Generic;
using System.Text;

namespace SimulationPTSystem.EnvironmentDevice.Codec
{
    /// <summary>
    /// 数据编码器
    /// </summary>
    public class DataEncoder:DataEncoderBase
    {
        /// <summary>
        /// 编码数据
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public override byte[] EncodeToByte(IEncodeData data)
        {
            if(data is EnvironmentDeviceData environmentDeviceData)
            {
                return data.ToBytes();
            }

            return base.EncodeToByte(data);
        }
    }
}
